﻿#light
open AbstractExample
open AppliedExample

let abstractExample() =
    // Abstract factory #1
    let factory1 = ConcreteFactory1()
    let c1 = Client(factory1)
    c1.Run()

    // Abstract factory #2
    let factory2 = ConcreteFactory2()
    let c2 = Client(factory2)
    c2.Run()

let appliedExample() =
    // Create and run the Africa animal world
    let africa = AfricaFactory()
    let africaWorld = AnimalWorld(africa)
    africaWorld.RunFoodChain()

    // Create and run the America animal world
    let america = AmericaFactory()
    let americaWorld = AnimalWorld(america)
    americaWorld.RunFoodChain()

abstractExample()
printfn "-------------"
appliedExample()
System.Console.ReadKey(true) |> ignore
